package serviceImpl;

import dao.LeaveMapper;
import entity.Leave;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import service.LeaveService;

import java.util.List;

@Service
public class LeaveServiceImpl implements LeaveService {
    @Autowired
    private LeaveMapper leaveMapper;

    @Override
    public List<Leave> getAllLeave() {
        return leaveMapper.getAllLeave();
    }

    @Override
    public boolean updateLeave(Leave leave) {
        return leaveMapper.updateLeave(leave);
    }

    @Override
    public boolean addLeave(Leave leave) {
        return leaveMapper.addLeave(leave);
    }

    @Override
    public boolean deleteLeave(String leaveID) {
        return leaveMapper.deleteLeave(leaveID);
    }

    @Override
    public Leave getLeaveByLeaveID(String leaveID) {
        return leaveMapper.getLeaveByLeaveID(leaveID);
    }

    @Override
    public boolean examineLeave(Leave leave) {
        return leaveMapper.examineLeave(leave);
    }

    @Override
    public List<Leave> searchLeave(String leaveID, String courseID, String stuNo) {
        return leaveMapper.searchLeave(leaveID,courseID,stuNo);
    }

}
